import urls from '../../../requestUrl.js'


const uploadUrlCommons = '/api/insurance/image/upload'

const components = {
    type1: [{
            itemType: 'uploader',
            title: '车牌或车架号图片上传',
            attentionText: '1.请按要求上传车牌或车架号图片\n2.仅能上传1张图片,图片必须拍照上传',
            name: 'carNumberImgs',
            files: [],
            count: 1,
            uploadUrl: urls.baseUrl + uploadUrlCommons,
            isUpload: false,
            uploadComplete: 'completeCarNumberImgsUpload',
            sourceType: 'camera', //'all/camera'
        },
        {
            itemType: 'uploader',
            title: '左前（右前）45度图片上传',
            attentionText: '1.请按要求上传车右前方45度及车左前方图片\n2.上传不少于1张图片,图片必须拍照上传',
            name: 'carFrontSideImgs',
            files: [],
            count: 10,
            uploadUrl: urls.baseUrl + uploadUrlCommons,
            isUpload: false,
            uploadComplete: 'completeCarFrontSideImgsUpload',
            sourceType: 'camera', //'all/camera'
        },
        {
            itemType: 'uploader',
            title: '左后（右后）45度图片上传',
            attentionText: '1.请按要求上传车右后方45度及车左后方图片\n2.上传不少于1张图片,图片必须拍照上传',
            name: 'carBackSideImgs',
            files: [],
            count: 10,
            uploadUrl: urls.baseUrl + uploadUrlCommons,
            isUpload: false,
            uploadComplete: 'completeCarBackSideImgsUpload',
            sourceType: 'camera', //'all/camera'
        },
        {
            itemType: 'input',
            title: '购买人姓名',
            placeholder: '请输入购买人的真实姓名',
            type: 'text',
            value: '',
            name: 'buyerName'
        },
        {
            itemType: 'input',
            title: '购买人电话',
            placeholder: '请输入购买人的联系方式',
            type: 'number',
            value: '',
            name: 'buyerTelphone'
        },
        {
            itemType: 'radio',
            title: '投保方式',
            items: [{label: '个人', value: 1}, {label: '公司', value: 2}],
            value: '1',
            name: 'insureType',
            disabled: true,
            handler: 'onBuyTypeChange'
        },
        {
            itemType: 'radio',
            title: '购买数量',
            items: [{label: '1', value: 1}, {label: '2', value: 2}, {label: '3', value: 3}, {label: '4', value: 4}],
            value: '1',
            name: 'quantity',
            disabled: false,
            handler: 'onBuyNumChange'
        },
        {
            itemType: 'readonly',
            title: '有效时间',
            type: 'number',
            value: '24小时',
            name: 'effectiveTime'
        },
    ],
    type2: [{
            itemType: 'uploader',
            title: '身份证或驾驶证图片上传',
            attentionText: '1.请按要求上传身份证或驾驶证图片\n2.仅能上传1张图片',
            name: 'userLicenceImgs',
            files: [],
            count: 1,
            uploadUrl: urls.baseUrl + uploadUrlCommons,
            isUpload: false,
            uploadComplete: 'completeUserLicenceImgsUpload',
            sourceType: 'all', //'all/camera'
        },
        {
            itemType: 'uploader',
            title: '人与车合照图片上传',
            attentionText: '1.请按要求上传人与车合照图片\n2.上传不少于1张图片,图片必须拍照上传',
            name: 'userCarImgs',
            files: [],
            count: 10,
            uploadUrl: urls.baseUrl + uploadUrlCommons,
            isUpload: false,
            uploadComplete: 'completeUserCarImgsUpload',
            sourceType: 'camera', //'all/camera'
        },
        {
            itemType: 'input',
            title: '司机姓名',
            placeholder: '请输入司机的真实姓名',
            type: 'text',
            value: '',
            name: 'driverName',
            disabled: false
        },
        {
            itemType: 'input',
            title: '司机电话',
            placeholder: '请输入司机的联系方式',
            type: 'number',
            value: '',
            name: 'driverMobile',
            disabled: false
        },
        {
            itemType: 'input',
            title: '乘客姓名',
            placeholder: '请输入乘客的真实姓名',
            type: 'text',
            value: '',
            name: 'passengerName'
        },
        {
            itemType: 'input',
            title: '乘客电话',
            placeholder: '请输入乘客的联系方式',
            type: 'number',
            value: '',
            name: 'passengerTelphone'
        }
    ],
    type3: [
        {
            itemType: 'uploader',
            title: '身份证正面图片上传',
            attentionText: '1.请按要求上传身份证正面图片\n2.仅能上传1张图片',
            name: 'idCardFrontImg',
            files: [],
            count: 1,
            uploadUrl: urls.baseUrl + uploadUrlCommons,
            isUpload: false,
            uploadComplete: 'completeIdCardFrontImgsUpload',
            sourceType: 'all', //'all/camera'
        },
        {
            itemType: 'uploader',
            title: '身份证反面图片上传',
            attentionText: '1.请按要求上传身份证反面图片\n2.仅能上传1张图片',
            name: 'idCardBackImg',
            files: [],
            count: 1,
            uploadUrl: urls.baseUrl + uploadUrlCommons,
            isUpload: false,
            uploadComplete: 'completeIdCardBackImgsUpload',
            sourceType: 'all', //'all/camera'
        },
        {
            itemType: 'radio',
            title: '投保方式',
            items: [{label: '个人', value: 1}, {label: '公司', value: 2}],
            value: '1',
            name: 'insureType',
            disabled: true,
            handler: 'onBuyTypeChange'
        },
        {
            itemType: 'radio',
            title: '购买数量',
            items: [{label: '一天', value: 1}, {label: '一周', value: 2}, {label: '一月', value: 3}],
            value: '1',
            name: 'quantity',
            disabled: false,
            handler: 'onBuyNumChange'
        },
        {
            itemType: 'readonly',
            title: '有效时间',
            type: 'number',
            value: '24小时',
            name: 'effectiveTime'
        },
        // {
        //     itemType: 'input',
        //     title: '购买人姓名',
        //     placeholder: '请输入购买人的真实姓名',
        //     type: 'text',
        //     value: '',
        //     name: 'buyName',
        //     disabled: true
        // },
        // {
        //     itemType: 'input',
        //     title: '购买人电话',
        //     placeholder: '请输入购买人的联系方式',
        //     type: 'number',
        //     value: '',
        //     name: 'buyTelphone',
        //     disabled: true
        // },
        {
            itemType: 'input',
            title: '被保障人姓名',
            placeholder: '请输入被保障人的真实姓名',
            type: 'text',
            value: '',
            name: 'buyerName',
        },
        {
            itemType: 'input',
            title: '被保障人电话',
            placeholder: '请输入被保障人的联系方式',
            type: 'number',
            value: '',
            name: 'buyerTelphone',
        },
        {
            itemType: 'input',
            title: '紧急联系人姓名',
            placeholder: '请输入紧急联系人的真实姓名',
            type: 'text',
            value: '',
            name: 'emergencyContactPerson'
        },
        {
            itemType: 'input',
            title: '紧急联系人电话',
            placeholder: '请输入紧急联系人的联系方式',
            type: 'number',
            value: '',
            name: 'emergencyContactNumber'
        },
    ]
}


module.exports = components
